<include file="public@header"/>
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">

			<li><a href="{:url('sit/index')}">场地</a></li>
			<li><a href="{:url('sit/addSite')}">添加</a></li>
			<li class="active"><a href="javascript:;">编辑</a></li>
			<!-- 	<li class="active><a href="{:url('station/index')}">园区添加</a></li> -->
			<!-- <li ><a href="javascript:;">编辑分类</a></li> -->
		</ul>

		<form method="post" class="form-horizontal  margin-top-20" action="editSite">

			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">场地名<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="site_name" value="{$detail.site_name}" required="true">
				</div>
			</div>
		<!-- 	<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">状态</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="status" id="parent_id">
						<option value="">==请选择==</option>
						<option value="0">禁用</option>
						<option value="1">可用</option>
						
					</select>
				</div>
			</div> -->
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">所属孵化器</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="incubator_id" id="parent_id">
						<option value="">==请选择==</option>
						<volist name="incubator_list" id="vo">
							<option value="{$vo.id}" <if condition="$detail.incubator_id eq $vo.id">selected</if>>{$vo.incubator_name}</option>
						</volist>
						
						
					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">类型</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="site_type_id" id="parent_id">
						<option value="">==请选择==</option>
						<volist name="site_type" id="vo">
							<option value="{$vo.id}" <if condition="$detail.site_type_id eq $vo.id">selected</if>>{$vo.name}</option>
						</volist>
						
						
					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">单价<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="price" value="{$detail.price}" required="true">
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">电话<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="mobile" value="{$detail.mobile}" required="true">
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">人数<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="people" value="{$detail.people}" required="true">
				</div>
			</div>

			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">开放开始时间<span class="form-required">*</span></label>
				<!-- <div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="start_time" value="{$detail.start_time}" >
				</div> -->
				<div class="col-md-2 col-sm-10">
					<select class="form-control" name="start_times" id="parent_id">
						<option value="">==请选择==</option>
						
							<option value="8"  <if condition="$detail['start_times'] eq 8">selected</if>>8时</option>
							<option value="9"  <if condition="$detail['start_times'] eq 9">selected</if>>9时</option>
							<option value="10" <if condition="$detail['start_times'] eq 10">selected</if>>10时</option>
							<option value="11" <if condition="$detail['start_times'] eq 11">selected</if>>11时</option>
							<option value="12" <if condition="$detail['start_times'] eq 12">selected</if>>12时</option>
							<option value="13" <if condition="$detail['start_times'] eq 13">selected</if>>13时</option>
							<option value="14" <if condition="$detail['start_times'] eq 14">selected</if>>14时</option>
							<option value="15" <if condition="$detail['start_times'] eq 15">selected</if>>15时</option>
							<option value="16" <if condition="$detail['start_times'] eq 16">selected</if>>16时</option>
							<option value="17" <if condition="$detail['start_times'] eq 17">selected</if>>17时</option>
							<option value="18" <if condition="$detail['start_times'] eq 18">selected</if>>18时</option>
						
						
						
					</select>
				</div>
				<div class="col-md-2 col-sm-10">
					<select class="form-control" name="start_timee" id="parent_id">
						<option value="">==请选择==</option>
						
							<option value="00" <if condition="$detail['start_timee'] eq 00">selected</if>>00分</option>
							<option value="30" <if condition="$detail['start_timee'] eq 30">selected</if>>30分</option>
							
						
						
						
					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">开放结束时间<span class="form-required">*</span></label>
				<!-- <div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="end_time" value="{$detail.end_time}" >
				</div> -->
				 <div class="col-md-2 col-sm-10">
					<select class="form-control" name="end_times" id="parent_id">
						<option value="">==请选择==</option>
						
							<option value="8" <if condition="$detail['end_times'] eq 8">selected</if>>8时</option>
							<option value="9" <if condition="$detail['end_times'] eq 9">selected</if>>9时</option>
							<option value="10" <if condition="$detail['end_times'] eq 10">selected</if>>10时</option>
							<option value="11" <if condition="$detail['end_times'] eq 11">selected</if>>11时</option>
							<option value="12" <if condition="$detail['end_times'] eq 12">selected</if>>12时</option>
							<option value="13" <if condition="$detail['end_times'] eq 13">selected</if>>13时</option>
							<option value="14" <if condition="$detail['end_times'] eq 14">selected</if>>14时</option>
							<option value="15" <if condition="$detail['end_times'] eq 15">selected</if>>15时</option>
							<option value="16" <if condition="$detail['end_times'] eq 16">selected</if>>16时</option>
							<option value="17" <if condition="$detail['end_times'] eq 17">selected</if>>17时</option>
							<option value="18" <if condition="$detail['end_times'] eq 18">selected</if>>18时</option>
						
						
						
					</select>
				</div>
				<div class="col-md-2 col-sm-10">
					<select class="form-control" name="end_timee" id="parent_id">
						<option value="">==请选择==</option>
						
							<option value="00" <if condition="$detail['end_timee'] eq 00">selected</if>>00分</option>
							<option value="30" <if condition="$detail['end_timee'] eq 30">selected</if>>30分</option>
							
						
						
						
					</select>
				
					
				</div>
			</div>

		<!-- 	<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">图片<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="pic" value="{$detail.pic}" required="true">
				</div>
			</div> -->
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">图片</label>
				<div class="col-md-6 col-sm-10">
					<imagetpl name="pic" id="img" value="$detail['pic']"/>
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">简介<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="site_sketch" value="{$detail.site_sketch}" required="true">
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">地址<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" name="address" value="{$detail.address}" required="true">
				</div>
			</div>
			<div class="form-group">
				<label for="input-user_email" class="col-sm-2 control-label"><span class="form-required"></span>可选设备</label>
				<div class="col-md-6 col-sm-10">
					<foreach name="equipments" item="vo">
						<label class="checkbox-inline">
							<input value="{$vo.id}" class="other" type="checkbox" name="other_equipments[]" >{$vo.name}
						</label>
					</foreach>
				</div>
			</div>
			<div class="form-group">
				<label for="input-user_email" class="col-sm-2 control-label"><span class="form-required"></span>固有设备</label>
				<div class="col-md-6 col-sm-10">
					<foreach name="equipments" item="vo">
						<label class="checkbox-inline">
							<input value="{$vo.id}" type="checkbox" class="stage" name="equipments[]" >{$vo.name}
						</label>
					</foreach>
				</div>
			</div>
			
				<input type="hidden" name="id" value="{$detail.id}">
		</div>
			<!-- <div class="form-group">
				<label for="input-remark" class="col-sm-2 control-label">备注</label>
				<div class="col-md-6 col-sm-10">
					<label class="radio-inline js-icheck"><input type="radio" name="status" value="1" checked>显示</label>
					<label class="radio-inline js-icheck"><input type="radio" name="status" value="0" <if condition="1">checked</if>>隐藏</label>
				</div>
			</div> -->
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<!-- <input type="hidden" name="id" value="1"> -->
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
					<a class="btn btn-default" href="{:url('index',['type_id'=>1])}">{:lang('BACK')}</a>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script type="text/javascript">
		$(function() {
			var equipments_checked=<?php echo $equipments_checked; ?>;
			$.each(equipments_checked,function(i,j){
				// $("input[value="+j+"]").attr("checked",true);
				  $(".stage").each(function(i){
                    // alert($(this).val());
                    var val = $(this).val();
                    if(val == j){
                    	
                        $(this).attr("checked",true);
                    }
                })
			})
			var other_equipments_checked=<?php echo $other_equipments_checked; ?>;
			$.each(other_equipments_checked,function(i,j){
				  $(".other").each(function(i){
                    // alert($(this).val());
                    var val = $(this).val();
                    if(val == j){
                    	
                        $(this).attr("checked",true);
                    }
                })
			})
			// var str=JSON.stringify(equipments_checked) ;
			
			// alert(str);
			// var checked=str.split(',');
			// alert(checked[1]);
		});
	</script>
</body>
</html>